package com.finger.gulimall.member.web;

import com.finger.common.utils.PageUtils;
import com.finger.gulimall.member.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @ClassName WebOrderController
 * @Description
 * @Author finger
 * @Date 2023/5/1 12:34
 * @Version 1.0
 */
@Controller
public class WebOrderController {

	@Autowired
	MemberService memberService;

	@GetMapping("/orderList.html")
	public String orderList(@RequestParam(defaultValue = "1", name = "page") Integer page, @RequestParam(defaultValue = "10", name = "limit") Integer limit, Model model) {
		PageUtils orders = memberService.getOrders(page, limit);
		model.addAttribute("page",orders);
		return "orderList";
	}
}
